﻿#ifndef NctiPythonTool_H
#define NctiPythonTool_H
#include "dcl_ncti_pubfun.h"
#include "ncti_base.h"
#include <functional>
#include <vector>
#include <map>
namespace NCTI
{
	enum CUSTOMDLGID
	{
		DLGID_MESH_QUALITY = 10001,
		DLGID_FEATURE_TREE= 10002,
		DLGID_COMMON_EDGE = 10003,
		DLGID_ABNORMAL_OBJECT = 10004
	};

	struct DocImage;
	using DialogCallback = std::function<bool(void* i_args, void* o_args, bool bReturn, void* mianWindow)>;
	using CustomDialogCallback = std::function<bool(void* i_args, void* o_args, bool bReturn,void* mianWindow)>;
	using ProgressCallback = std::function<void(int progress)>;
	class DECL_NCTI_PUBFUN NctiPythonTool
	{
	public:
		static void SetDialogCallbackFun(DialogCallback fun, void* mainWindow = nullptr) { m_DialogCallback = fun; m_pMainWindow = mainWindow;}
		static bool RunGetDialogCallbackFun(void* i_args, void* o_args, bool bReturn);
		static bool CheckDialogCallbackFun();
		static void SetDialogIDs(std::vector<Ncti_Long> dialogIDVec);
		static const std::vector<Ncti_Long>& GetDialogIDs() { return m_DialogIDVec; }
		static bool CheckShowDialog(Ncti_Long id);

		static void SetCustomDialogCallbackFun(CustomDialogCallback fun, void* mainWindow) { m_customDialogCallback = fun;m_mainWindow = mainWindow; };
		static bool RunGetCustomDialogCallbackFun(void* i_args, void* o_args, bool bReturn);
		static bool CheckCustomDialogCallbackFun();

	    static void SetProgressCallbackFun(ProgressCallback fun) { m_ProgressCallback = fun;}
        static void RunProgressCallbackFun(Ncti_Integer progress);
        static bool CheckProgressCallbackFun();
	private:
		static void* m_pMainWindow;
		static DialogCallback m_DialogCallback;
		static std::vector<Ncti_Long> m_DialogIDVec;

		static void* m_mainWindow;
		static CustomDialogCallback m_customDialogCallback;

        static ProgressCallback m_ProgressCallback;
	};
}
#endif
